package ml.classification;

public class ClassificationStatistics {
	public String fileName;

	public double maximumGain;
	public double predictedGain;
	public double postprocessedGain;
	public double speechAlwaysTrueGain;

	public int trueClassNoMusic;
	public int trueClassMusicSpeech;
	public int trueClassMusicOnly;

	public int predictedClassNoMusic;
	public int predictedClassMusicSpeech;
	public int predictedClassMusicOnly;

	public int postprocessedClassNoMusic;
	public int postprocessedClassMusicSpeech;
	public int postprocessedClassMusicOnly;

	public int trueClassMusic;
	public int trueClassSpeech;

	public int predictedClassMusic;
	public int predictedClassSpeech;

	public int postprocessedClassMusic;
	public int postprocessedClassSpeech;

	public double predictedAccuracyClass;
	public double postprocessedAccuracyClass;

	public double predictedAccuracyMusic;
	public double predictedAccuracySpeech;

	public double postprocessedAccuracyMusic;
	public double postprocessedAccuracySpeech;

	public String musicFilter;
	public int musicN;
	public int musicIterations;

	public String speechFilter;
	public int speechN;
	public int speechIterations;
	public double speechThreshold;

	public String musicModelFileName;
	public String speechModelFileName;

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder();
		sb.append(fileName);
		sb.append(";");
		sb.append(String.valueOf(maximumGain).replace(".", ","));
		sb.append(";");
		sb.append(String.valueOf(predictedGain).replace(".", ","));
		sb.append(";");
		sb.append(String.valueOf(postprocessedGain).replace(".", ","));
		sb.append(";");
		sb.append(String.valueOf(speechAlwaysTrueGain).replace(".", ","));
		sb.append(";");
		sb.append(";");
		sb.append(String.valueOf(predictedAccuracyClass).replace(".", ","));
		sb.append(";");
		sb.append(String.valueOf(postprocessedAccuracyClass).replace(".", ","));
		sb.append(";");
		sb.append(";");
		sb.append(String.valueOf(predictedAccuracyMusic).replace(".", ","));
		sb.append(";");
		sb.append(String.valueOf(postprocessedAccuracyMusic).replace(".", ","));
		sb.append(";");
		sb.append(";");
		sb.append(String.valueOf(predictedAccuracySpeech).replace(".", ","));
		sb.append(";");
		sb.append(String.valueOf(postprocessedAccuracySpeech).replace(".", ","));
		sb.append(";");
		sb.append(";");
		sb.append(trueClassNoMusic);
		sb.append(";");
		sb.append(trueClassMusicSpeech);
		sb.append(";");
		sb.append(trueClassMusicOnly);
		sb.append(";");
		sb.append(";");
		sb.append(predictedClassNoMusic);
		sb.append(";");
		sb.append(predictedClassMusicSpeech);
		sb.append(";");
		sb.append(predictedClassMusicOnly);
		sb.append(";");
		sb.append(";");
		sb.append(postprocessedClassNoMusic);
		sb.append(";");
		sb.append(postprocessedClassMusicSpeech);
		sb.append(";");
		sb.append(postprocessedClassMusicOnly);
		sb.append(";");
		sb.append(";");
		sb.append(trueClassMusic);
		sb.append(";");
		sb.append(trueClassSpeech);
		sb.append(";");
		sb.append(";");
		sb.append(predictedClassMusic);
		sb.append(";");
		sb.append(predictedClassSpeech);
		sb.append(";");
		sb.append(";");
		sb.append(postprocessedClassMusic);
		sb.append(";");
		sb.append(postprocessedClassSpeech);
		sb.append(";");
		sb.append(";");
		sb.append("\"" + musicFilter + "\"");
		sb.append(";");
		sb.append(String.valueOf(musicN));
		sb.append(";");
		sb.append(String.valueOf(musicIterations));
		sb.append(";");
		sb.append(";");
		sb.append("\"" + speechFilter + "\"");
		sb.append(";");
		sb.append(String.valueOf(speechN));
		sb.append(";");
		sb.append(String.valueOf(speechIterations));
		sb.append(";");
		sb.append(String.valueOf(speechThreshold).replace(".", ","));
		sb.append(";");
		sb.append(";");
		sb.append(String.valueOf(musicModelFileName));
		sb.append(";");
		sb.append(String.valueOf(speechModelFileName));
		return sb.toString();
	}

	public static String getHeader() {
		final StringBuilder sb = new StringBuilder();
		sb.append("\"File name\"");
		sb.append(";");
		sb.append("\"Maximum Gain\"");
		sb.append(";");
		sb.append("\"Predicted Gain\"");
		sb.append(";");
		sb.append("\"Postprocessed Gain\"");
		sb.append(";");
		sb.append("\"SpeechAlwaysTrue Gain\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"Predicted Accuracy Class\"");
		sb.append(";");
		sb.append("\"Postprocessed Accuracy Class\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"Predicted Accuracy Music\"");
		sb.append(";");
		sb.append("\"Postprocessed Accuracy Music\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"Predicted Accuracy Speech\"");
		sb.append(";");
		sb.append("\"Postprocessed Accuracy Speech\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"True Class NoMusic\"");
		sb.append(";");
		sb.append("\"True Class MusicSpeech\"");
		sb.append(";");
		sb.append("\"True Class MusicOnly\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"Predicted Class NoMusic\"");
		sb.append(";");
		sb.append("\"Predicted Class MusicSpeech\"");
		sb.append(";");
		sb.append("\"Predicted Class MusicOnly\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"Postprocessed Class NoMusic\"");
		sb.append(";");
		sb.append("\"Postprocessed Class MusicSpeech\"");
		sb.append(";");
		sb.append("\"Postprocessed Class MusicOnly\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"True Class Music\"");
		sb.append(";");
		sb.append("\"True Class Speech\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"Predicted Class Music\"");
		sb.append(";");
		sb.append("\"Predicted Class Speech\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"Postprocessed Class Music\"");
		sb.append(";");
		sb.append("\"Postprocessed Class Speech\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"musicFilter\"");
		sb.append(";");
		sb.append("\"musicN\"");
		sb.append(";");
		sb.append("\"musicIterations\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"speechFilter\"");
		sb.append(";");
		sb.append("\"speechN\"");
		sb.append(";");
		sb.append("\"speechIterations\"");
		sb.append(";");
		sb.append("\"speechThreshold\"");
		sb.append(";");
		sb.append(";");
		sb.append("\"Music Model\"");
		sb.append(";");
		sb.append("\"Speech Model\"");
		return sb.toString();
	}
}
